<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    race方法：如果有最先达到状态的，不管成功还是失败，都以这个为结果
    <script>
        let p1 = new Promise((resolve,reject)=>{
            setTimeout(()=>{
                resolve('ok')
            },1000)
        })
        let p2 = new Promise((resolve,reject)=>{
            setTimeout(()=>{
                resolve('okk')
            },3000)
        })
        let p3 = new Promise((resolve,reject)=>{
            setTimeout(()=>{
                resolve('okkk')
            },5000)
        })
        let reslut = Promise.race([p3,p2,p1])
        console.log(reslut);
        
    </script>
</body>
</html>